import QtQuick 1.0

QMLTwitterBase{
    id: _root

    //////////////////////////////////////////////////////////
    // properties


    //////////////////////////////////////////////////////////
    // changed


    //////////////////////////////////////////////////////////
    // signals

    signal responseFavorites(string text)
    signal responseFavoritesCreate(string text)
    signal responseFavoritesDestory(string text)


    //////////////////////////////////////////////////////////
    // methods


    function favorites(id, since_id, page, include_entities){
        var content = {};
        if(!isNullOrEmpty(id)){
            content.id = id;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        requestAPI("GET", "URL_FAVORITES"
                   , content, responseFavorites);
    }

    function favoritesCreate(id, include_entities){
        var content = {};
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        requestAPI("POST", "URL_FAVORITES_CREATE"
                   , null, responseFavoritesCreate
                   , id);
    }

    function favoritesDestory(id){
        var content = {};
        requestAPI("POST", "URL_FAVORITES_DESTROY"
                   , content, responseFavoritesDestory
                   , id);
    }
}
